package lgq.service;

import java.util.List;

import model.Teacher;
import util.Page;
import dao.TeacherDAO;
import dao.impl.TeacherDAOImpl;

public class TeacherManager {
	TeacherDAO td=new TeacherDAOImpl();
	public Page<Teacher>getAllTeacher(int pageNo,int pageSize)
	{
		return td.getAll(pageNo, pageSize);
	}
	public Teacher getById(int id)
	{
		return td.getById(id);
	}
	public boolean addTeacher(String name)
	{
		Teacher t=new Teacher();
		t.setName(name);
		return td.add(t);
	}
	public boolean updateTeacher(int id,String name)
	{
		Teacher t=new Teacher();
		t.setId(id);
		t.setName(name);
		return td.update(t);
	}
	public boolean deleteById(int id)
	{
		return td.deleteById(id);
	}
	public List<Teacher>getAll()
	{
		return td.getAll();
	}
	public Page<Teacher> getByName(int pageNo,int pageSize,String name)
	{
		return td.getByName(pageNo, pageSize, name);
	}
}
